
#include "../include/Server.h"
#include "../include/logger.h"
#include "../include/Configuration.h"
#include "../include/MySQLConnector.h"
#include <iostream>

#define CONFIG_FILE_NAME "../conf/server.conf"
using std::endl;
using std::cout;

int main()
{
    Configuration *config = Configuration::getInstance();
    config->loadConfigData(CONFIG_FILE_NAME);
    MySQLConnector* mysqlconn = MySQLConnector::getInstance();
    bool ret = mysqlconn->connect("127.0.0.1", 
                                      "root", "1234", "wangdao");
    Server server(config->getThreadNum(),config->getTaskNum(),
                  config->getIp(),config->getPort());
    server.start();
    Configuration::destory();
    Logger::destroy();
    MySQLConnector::destory();

    return 0;
}

